<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var arr = ["a", "b", "c", "d", "e", "f"];
        // 一个值，表示从该下标值截取到最后
        // slice 返回截取的数组
        console.log(arr.slice(2));

        // 可以用slice复制复杂数据类型

        var arr2 = arr.slice(0);
        arr2[0] = 'x';
        console.log(arr);
        console.log(arr2);
    </script>
</body>
</html>